﻿Ext.define('passport.view.factory.FactoryEditView', {
    extend: 'Ext.window.Window',
    alias : 'widget.factoryEditView',
    requires: ['Ext.form.Panel'],
    title : 'Edit Factory',
    layout: 'fit',
    autoShow: true,
    height: 320,
    width: 300,
    initComponent: function() {
        this.items = [
            {
                xtype: 'form',
                padding: '5 5 0 5',
                border: false,
                style: 'background-color: #fff;',
                items: [
                    {
                        xtype: 'textfield',
                        name : 'id',
                        fieldLabel: 'id',
                       	allowBlank: false,
                       	hidden: true
                    },
                    {
                        xtype: 'textfield',
                        name : 'code',
                        fieldLabel: 'Code',
                        allowBlank: false,
                        maxLength: '8',
                        minLength: '2',
                        allowBlank: false
                    },
                    {
                        xtype: 'textfield',
                        name : 'shortName',
                        fieldLabel: 'Short Name',
                        allowBlank: false
                    },
                    {
                        xtype: 'textfield',
                        name : 'fullName',
                        fieldLabel: 'Full Name',
                        allowBlank: false
                    },
                    {
                        xtype: 'textfield',
                        name : 'location',
                        fieldLabel: 'Location'
                    },
                    {
                        xtype: 'textfield',
                        name : 'address',
                        fieldLabel: 'Address'
                    },
                    {
                        xtype: 'textfield',
                        name : 'tel',
                        fieldLabel: 'Tel'
                    },
                    {
                        xtype: 'textfield',
                        name : 'contact',
                        fieldLabel: 'Contact'
                    },
                    {
                        xtype: 'textfield',
                        name : 'isActive',
                        fieldLabel: 'Active'
                    }
                ]
            }
        ];
        this.buttons = [
            {
                text: 'Save',
                action: 'save'
            },
            {
                text: 'Cancel',
                scope: this,
                handler: this.close
            }
        ];
        this.callParent(arguments);
    }
});
